﻿using System.Collections;

namespace PMS.Utils
{
    public static class HashtableExtend
    {
        /// <summary>
        /// 判断Hashtable的值是否为空 不为空返回true 否则返回false
        /// </summary>
        /// <param name="ht"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public static bool IsNullOrEmptyByKey(this Hashtable ht, string key)
        {
            return ht[key] != null && !string.IsNullOrEmpty(ht[key].ToString());
        }

        public static string ToKeyString(this Hashtable ht, string key)
        {
            return ht[key].ToString();
        }
    }
}